package Chapter4;

import java.time.DayOfWeek;
import java.time.LocalDate;
import java.util.Date;

public class DateDmo {
    public static void main(String[] args) {
//        //使用Date
////        Date dt = new Date();
////        //取当前时间日期
////        System.out.println(dt);
////        //LocalDate
////        //获取当前时间
////
////        //构造一个时间
////        //形参不可变 实参可变
////        LocalDate ld1 = LocalDate.of(2018,8,8);
////        System.out.println(ld1);
////        //生成当月日历
////        //1.去当前时间日期
////        LocalDate ld = LocalDate.now();
////        System.out.println(ld);
////        //2.获取当月第一天的是周几 DayOfWeek
////        LocalDate ld2 = ld.minusDays(ld.getDayOfMonth() - 1);
////        System.out.println(ld2);
////        DayOfWeek dw =  ld2.getDayOfWeek();
////        System.out.println(dw.getValue());
////        //3.通过循环逐一输出
////        System.out.println("Mon Tue Wen Thu Fri Sta Sun");
////        for (int i = 0; i < dw.getValue();i++){
////            System.out.println("   ");
////        }
////        //4. 逐一输出 每天加1 直到月份不等于当前月份
////        //如果获取DayOfWeek是1的话需要换行
////        Student stu1,stu2;
////        stu1 = new Student();//new是一个特殊的操作符
////        stu2 = new Student();
        //1. 定义对象变量
        Caculer cal;
        //2. 实例化对象
        cal = new Caculer(10,20,"*");
        //3. 调用相关方法
        System.out.println(cal.getResult());
        cal.setNum1(11);
        System.out.println(cal.getResult());
        cal.setNum1(100);
        System.out.println(cal.getResult());
    }
}
